Class: Backoff
Constructors
constructor
• new Backoff(opts?
)
Parameters
Name | Type |
---|---|
opts? | Object |
opts.factor? | number |
opts.jitter? | number |
opts.max? | number |
opts.min | number |
Properties
attempts
• Private
attempts: number
= 0
factor
• Private
factor: number
= 2
jitter
• Private
jitter: number
= 0
max
• Private
max: number
= 10_000
ms
• Private
ms: number
= 100
Methods
duration
▸ duration(): number
Returns
number
promise
▸ promise(): Promise
<unknown
>
Returns
Promise
<unknown
>
reset
▸ reset(): void
Returns
void